﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using AspNetCs.Model;
using AspNetCs.IDAL;
using AspNetCs.DALFactory;

namespace AspNetCs.Bll
{
    public class GuestBLL
    {
        private IGuest guestDAL = Conn.CreateGuest(); 

        /// <summary>
        /// 获得留言列表
        /// </summary>
        /// <returns></returns>
        public DataTable getGuestList()
        {
            return guestDAL.getGuestList();
        }

        /// <summary>
        /// 通过留言编号查询留言详细内容
        /// </summary>
        /// <param name="guestId"></param>
        /// <returns></returns>
        public DataTable getGuestInfoByGuestId(int guestId)
        {
            return guestDAL.getGuestInfoByGuestId(guestId);
        }

        /// <summary>
        /// 删除留言
        /// </summary>
        /// <param name="guestId"></param>
        /// <returns></returns>
        public int deleteGuestByGuestId(int guestId)
        {
            return guestDAL.deleteGuestByGuestId(guestId);
        }

        /// <summary>
        /// 审核通过或者取消审核
        /// </summary>
        /// <param name="guestId"></param>
        /// <param name="passOrNoPass"></param>
        /// <returns></returns>
        public int checkPass(int guestId, int passOrNoPass)
        {
            return guestDAL.checkPass(guestId,passOrNoPass);
        }

        /// <summary>
        /// 管理员回复
        /// </summary>
        /// <param name="guestId"></param>
        /// <param name="replyContent"></param>
        /// <param name="addTime"></param>
        /// <returns></returns>
        public int addReply(int guestId, string replyContent, DateTime addTime)
        {
            return guestDAL.addReply(guestId,replyContent,addTime);
        }

        /// <summary>
        /// 用户发表留言
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int addGuest(Guest_Model model)
        {
            return guestDAL.addGuest(model);  
        }
    }
}
